#include<iostream>
#include<vector>
#include<assert.h>
using namespace std;

//template<class T>
//class vector
//{
//	T& operator[](int i)
//	{
//		assert(i < _size);
//		return _a[i];
//	}
//
//private:
//	T* _a;
//	size_t _size;
//	size_t capacity;
//};
//
//class vector
//{
//	int& operator[](int i)
//	{
//		assert(i < _size);
//		return _a[i];
//	}
//private:
//	int* _a;
//	size_t _size;
//	size_t _capacity;
//};
////void test()
////{
////	vector<int> v1;
////
////	vector<int> v2(10, 1);
////	vector<int> v3(++v2.begin(), --v2.end());
////
////	for (size_t i = 0; i < v3.size(); i++)
////	{
////		cout << v3[i] << " ";
////	}
////		cout << endl;
////
////	vector<int>::iterator it = v3.begin();
////	while (it != v3.end())
////	{
////		cout << *it << " ";
////		++it;
////	}
////	cout << endl;
////
////	for (auto ch : v3)
////	{
////		cout << ch << " ";
////	}
////}
////
////void test1()
////{
////	vector<int> v1;
////
////	vector<int> v2(10, 1);
////	vector<int> v3(++v2.begin(), --v2.end());
////
////	v2.resize(5);
////
////}
////
////void test2()
////{
////	vector<int> v(10, 1);
////     
////	for (auto ch : v)
////	{
////		cout << ch << " ";
////	}
////	cout << endl;
////
////	v.insert(v.begin(), 2);
////	for (auto ch : v)
////	{
////		cout << ch << " ";
////	}
////	cout << endl;
////
////	v.push_back(2);
////	for (auto ch : v)
////	{
////		cout << ch << " ";
////	}
////	cout << endl;
////
////	v.insert(v.begin()+3, 5);
////	for (auto ch : v)
////	{
////		cout << ch << " ";
////	}
////	cout << endl;
////
////
////	vector<int> a(5, 2);
////	vector<vector<int>> vv(10, a);
////	vv[2][1] = 1;
////}
////void test3()
////{
////	vector<int> b(5, 2);
////	vector<vector<int>> bb(10, b);
////	for (size_t i = 0; i < bb.size(); i++)
////	{
////		for (size_t j = 0; j < bb[i].size(); j++)
////		{
////			cout << bb[i][j]<<" ";
////		}
////		cout << endl;
////	}
////	cout << endl;
////}
////int main()
////{
////	test3();
////	return 0;
////}

class Solution {
public:
	vector<vector<int>> generate(int numRows) {
		vector<vector<int>> vv(numRows);
		for (int i = 0; i < numRows; i++)
		{
			vv[i].resize(i + 1, 1);
		}
		for (size_t i = 2; i < vv.size(); i++)
		{
			for (size_t j = 1; j < vv[i].size() - 1; j++)
			{
				vv[i][j] = vv[i - 1][j] + vv[i - 1][j - 1];
			}
		}
		return vv;
	}
};